<template>
    <div>
      <detail-banner
        :sightName="sightName"
        :bannerImg="bannerImg"
        :gallaryImgs="gallaryImgs"

      ></detail-banner>
      <detail-header ></detail-header>
      <detail-intro></detail-intro>
      <div class="content">
        <detail-list :categoryList="categoryList"></detail-list>
      </div>
    </div>
</template>

<script>
import DetailBanner from './components/banner.vue'
import DetailHeader from './components/header.vue'
import DetailList from './components/list.vue'
import DetailIntro from './components/intro.vue'
import axios from 'axios'

export default {
  name: 'Detail',
  props: {},
  data () {
    return {
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      categoryList: []
    }
  },
  methods: {
    getDetailInfo () {
      axios.get('/api/detail.json', {
        params: {
          id: this.$route.params.id
        }
      }).then((res) => {
        res = res.data
        if (res.ret && res.data) {
          this.sightName = res.data.sightName
          this.bannerImg = res.data.bannerImg
          this.gallaryImgs = res.data.gallaryImgs
          this.categoryList = res.data.categoryList
        }
      })
    }
  },
  components: {
    DetailBanner,
    DetailHeader,
    DetailList,
    DetailIntro
  },
  computed: {},
  mounted () {
    this.getDetailInfo()
  }
}
</script>

<style  lang="stylus" scoped>
  .content
    height :50rem
</style>
